<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>保险公司</title>
<link href="../style/main.css" rel="stylesheet" type="text/css" />
<link type="text/css" rel="stylesheet" href="../css/style.css" />

<script>

 function changeV(objID)
			{
				if(document.getElementById("tbody_"+objID).style.display == "")
				{
					
					document.getElementById("img_"+objID).src = "../images/ico_have2.gif";
					document.getElementById("tbody_"+objID).style.display = "none"
				}
				else
				{
					document.getElementById("img_"+objID).src = "../images/ico_nohave2.gif";
					document.getElementById("tbody_"+objID).style.display = ""
				}
			}
function editCompany(){
	var comps_del = document.getElementsByName("companysDel");
	var count = 0;
	var index = 0; 
	for(var i = 0; i < comps_del.length; i ++){
		if(comps_del[i].checked){
			count ++;
			index = i;
		}
	}
	if(count == 1){
		window.location.href = "findCompanyAction.action?company.companyNum="+comps_del[index].value;
	}
	else{
		window.alert("请选择一个编辑选项");
	}
	return false;
}
function delCompany(){
	var comps_del = document.getElementsByName("companysDel");
	var count = 0;
	var index = 0; 
	for(var i = 0; i < comps_del.length; i ++){
		if(comps_del[i].checked){
			count ++;
			index = i;
		}
	}
	if(count == 1){
		window.location.href = "deleteCompanyAction.action?company.companyNum="+comps_del[index].value;
	}
	else{
		window.alert("请选择一个编辑选项");
	}
	return false;
}
</script>

</head>
<body>
<table width="1200" align="left" cellpadding="0" cellspacing="0" class="table">
  <tr>
    <td>
      <table width="100%"  cellpadding="0" cellspacing="0" class="table2">
        <tr>
          <td valign="top">
            <table width="100%" class="top" cellpadding="0" cellspacing="0">
              <tr>
                <td>当前位置:&nbsp;产品管理&nbsp;&gt;&gt;&nbsp;保险公司</td>
              </tr>
            </table>
			<div id="mainareacontent">
        <div class="mainarea">
        <s:form action="inquireCompanyAction" method="post" theme="simple" id="inquire">
            <div class="search">			
                <table width="100%" cellpadding="0" cellspacing="0">
                    <tr>
                        <td height="209" class="ico">
                            <a href="javascript:changeV(1)">
                                <img src="../images/ico_have2.gif" width="13" border="0" id="img_1"/></a>                        </td>
                      <td >
                      <table cellpadding="0" cellspacing="0" width="100%" >
                        <tr>
                          <td width="8%"> 公司编号： </td>
                          <td width="14%"><s:textfield name="company.companyNum"/>                          </td>
                          <td width="12%"> 保险公司名称（中文）： </td>
                          <td width="12%"><s:textfield name="company.companynameC"/></td>
                          <td width="9%" height="30" align="right">业务类型： </td>
                          <td width="19%">
                          <s:select name="company.businesstype" list="#{'':'--全部--','综合':'综合','财产险':'财产险','人寿险':'人寿险','再保险':'再保险','其他':'其他'}">
                			</s:select>
                		</td>
                          <td width="26%"><img src="../images/btn_search.gif" onclick="javascript:document.getElementById('inquire').submit();"/>&nbsp;<img src="../images/btn_reset.gif" width="50" height="20" /> </td>
                        </tr>
                        <tbody id="tbody_1" style="display: none; border: 0px;width:100%">
                          <tr>
                            <td width="8%">行政级别： </td>
                            <td width="14%" > <s:select name="company.adlevel" list="#{'':'--全部--','总公司':'总公司','分公司':'分公司','办事处':'办事处','其他':'其他'}">
                  			</s:select></td>
                            <td width="12%">&nbsp;</td>
                            <td width="12%">&nbsp;</td>
                            <td width="9%" align="right">&nbsp;</td>
                            <td width="19%">&nbsp;</td>
                            <td width="26%">&nbsp;</td>
                          </tr>
                        </tbody>
                      </table></td>
                    </tr>
                </table>
            </div>
            <!----------- 数据列表 ------------------>
            <fieldset>
                <legend>
                    <table width="100%" cellpadding="0" cellspacing="0"class="table3">
                        <tr>
                            <td width="6%" class="title">&nbsp;</td>
                            <td width="5%" ><span class="clientinfo_but"><a href="Insurancecompany_new.jsp">新&nbsp;增</a></span></td>
                          <td width="5%" ><span class="clientinfo_but" ><a href="#" onclick="editCompany()">修&nbsp;改</a></span></td>
                          <td width="5%" ><img src="../images/btn_del.gif" alt="3" onclick="delCompany()"/></td>
                            <td width="5%" >&nbsp;</td>
                            <td width="18%" >&nbsp;</td>
                            <td width="5%" ><span class="clientinfo_but">导&nbsp;入</span></td>
                            <td width="5%" ><span class="clientinfo_but">导&nbsp;出</span></td>
                          
                            <td width="5%" ><span class="clientinfo_but">打&nbsp;印</span></td>  
                            <td width="14%" >&nbsp;</td>
                        </tr>
                    </table>
            </legend>
            <table width="100%" cellpadding="0" cellspacing="1" class="dg_borderstyle">
              <thead>
                <tr>
                  <th width="37" height="52">&nbsp;</th>
                  <th width="89">保险公司编号</th>
                  <th width="103">保险公司名称</th>
                  <th width="78">公司简称</th>
                  <th width="71">行政级别</th>
                  <th width="69">业务类型</th>
                  <th width="60">联系人</th>
                  <th width="82">公司地址</th>
                  <th width="69">电话</th>
                  <th width="57">传真</th>
                  <th width="80">电子邮箱</th>
                  <th width="96">公司主页</th>
                  <th width="92">保险编号标签</th>
                </tr>
              </thead>
              <tbody >
              <s:iterator value="companyList">
                <tr>
                  <td><input type="radio" name="companysDel"  value="<s:property value='companyNum'/>"/></td>
                  <td><s:property value="companyNum"/></td>
                  <td><s:property value="companynameC"/></td>
                  <td><s:property value="shortName"/></td>
                  <td><s:property value="adlevel"/></td>
                  <td><s:property value="businesstype"/></td>
                  <td><s:property value="ccontactMan"/></td>
                  <td ><s:property value="companyAddress"/></td>
                  <td ><s:property value="ctelephone"/></td>
                  <td ><s:property value="cfax"/></td>
                  <td ><s:property value="cemail"/></td>
                  <td ><s:property value="webAddress"/></td>
                  <td ><s:property value="cmemo"/></td>
                </tr>
                </s:iterator>
              </tbody>
            </table>
            </fieldset>
            <table width="100%" cellpadding="0" cellspacing="0" class="dg_pagestyle">
                <tr>
                    <td class="pageinfo">
                         共<s:property value="pager.pageCount"/>页/<s:property value="pager.recordCount"/>条记录                    </td>
                    <td class="pagebutton">
                        每页
                        <s:select list="#{'1':'1','20':'20','50':'50'}" name="pager.pageSize">
                        </s:select>
                        条记录 | 第<s:textfield name="pager.pageCurrent" cssStyle="width: 20px;" id="pagecurrent"/>页<img src="../images/btn_go.gif" onclick="document.getElementById('inquire').submit();"/>
                        <img src="../images/btn_sy.gif" onclick="goToPage(1)"/>
                         <s:if test="pager.pageCurrent > 1">
                        <img src="../images/btn_syy.gif" onclick="goToPage(<s:property value='pager.pageCurrent - 1'/>)"/>
                        </s:if>
                        <s:if test="pager.pageCurrent < pager.pageCount">
                        <img src="../images/btn_xyy.gif" onclick="goToPage(<s:property value='pager.pageCurrent + 1'/>)"/>
                        </s:if>
                        <img src="../images/btn_wy.gif" onclick="goToPage(<s:property value='pager.pageCount'/>)"/></td>
                </tr>
            </table>
            </s:form>
        </div>
        
        
      </div>          </td>
        </tr>
        <tr>
          <td>&nbsp;</td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<script type="text/javascript">
function goToPage(page){
	document.getElementById("pagecurrent").value = page;
	document.getElementById("inquire").submit();
}
</script>
</body>
</html>
